cmake_minimum_required(VERSION 2.8)
project(ffmpeg-test)

#set(CMAKE_C_COMPILER  gcc-5)
#set(CMAKE_CXX_COMPILER  g++-5)
set(CMAKE_BUILD_TYPE Release ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#set(CMAKE_CXX_VISIBILITY_PRESET     hidden)
#set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

set(SRC_DIR ./)
set(SOURCES
    ${SRC_DIR}/video_dec.cpp
)

include_directories(
    ${SRC_DIR}
    /usr/local/ffmpeg/include/
)

link_directories(
    /usr/local/ffmpeg/lib
)

add_compile_options(
    -Wall 
    -Wno-sign-compare 
    -Wno-comment 
    -Wno-unused-parameter 
    -Wno-unused-function
    -Wno-deprecated-declarations
    -Wno-attributes)
if(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS " -std=c++11 -Wno-reorder")
    message(STATUS "optional:-std=c++11")
endif(CMAKE_COMPILER_IS_GNUCXX)

# compile for front unit test
#add_library(sgdec SHARED ${SOURCES} )
#target_link_libraries(sgdec )

#add_executable(dec_mp3 main.cpp)
add_executable(dec_test ${SOURCES} )
target_link_libraries(dec_test m rt pthread
    avcodec
    avformat
    avfilter
    avutil
    swresample
    swscale
    )

